.class public Lcom/burstly/lib/BurstlySdk;
.super Ljava/lang/Object;
.source "BurstlySdk.java"


# static fields
.field private static final NOT_INITIALIZED_MESSAGE:Ljava/lang/String; = "Call BurstlySdk.init(context) method first!"

.field private static final TAG:Ljava/lang/String; = "BurstlySdk"

.field private static volatile sIsInitialized:Z

.field private static sLog:Lcom/burstly/lib/util/LoggerExt;


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 49
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static getSdkVersion()Ljava/lang/String;
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/burstly/lib/exception/BurstlySdkNotInitializedException;
        }
    .end annotation

    .prologue
    .line 181
    sget-boolean v0, Lcom/burstly/lib/BurstlySdk;->sIsInitialized:Z

    if-eqz v0, :cond_0

    .line 182
    sget-object v0, Lcom/burstly/lib/constants/Constants;->SDK_VERSION:Ljava/lang/String;

    return-object v0

    .line 184
    :cond_0
    new-instance v0, Lcom/burstly/lib/exception/BurstlySdkNotInitializedException;

    const-string v1, "Call BurstlySdk.init(context) method first!"

    invoke-direct {v0, v1}, Lcom/burstly/lib/exception/BurstlySdkNotInitializedException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public static init(Landroid/content/Context;)V
    .locals 6
    .parameter "context"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/burstly/lib/exception/WrongThreadException;
        }
    .end annotation

    .prologue
    .line 80
    const/4 v2, 0x1

    sput-boolean v2, Lcom/burstly/lib/BurstlySdk;->sIsInitialized:Z

    .line 81
    invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    .line 84
    .local v0, appContext:Landroid/content/Context;
    invoke-static {v0}, Lcom/burstly/lib/constants/BurstlyProperties;->initProperties(Landroid/content/Context;)V

    .line 87
    invoke-static {v0}, Lcom/burstly/lib/feature/FeatureFactory;->init(Landroid/content/Context;)V

    .line 89
    sget-object v2, Lcom/burstly/lib/BurstlySdk;->sLog:Lcom/burstly/lib/util/LoggerExt;

    if-nez v2, :cond_0

    .line 90
    invoke-static {}, Lcom/burstly/lib/util/LoggerExt;->getInstance()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v2

    sput-object v2, Lcom/burstly/lib/BurstlySdk;->sLog:Lcom/burstly/lib/util/LoggerExt;

    .line 94
    :cond_0
    invoke-static {v0}, Lcom/burstly/lib/util/Utils;->getUserAgentString(Landroid/content/Context;)Ljava/lang/String;

    .line 97
    invoke-static {v0}, Lcom/burstly/lib/util/ManifestValidator;->validate(Landroid/content/Context;)V

    .line 100
    invoke-static {v0}, Lcom/burstly/lib/util/Utils;->initCCSString(Landroid/content/Context;)V

    .line 103
    invoke-static {v0}, Lcom/burstly/lib/util/Utils;->setApplicationContext(Landroid/content/Context;)V

    .line 106
    invoke-static {}, Lcom/burstly/lib/exception/UiExceptionHandlerManager;->init()V

    .line 109
    invoke-static {v0}, Lcom/burstly/lib/network/request/RequestManager;->initRquestManager(Landroid/content/Context;)V

    .line 112
    invoke-static {v0}, Lcom/burstly/lib/service/HostsProviderManager;->init(Landroid/content/Context;)V

    .line 115
    invoke-static {v0}, Lcom/burstly/lib/network/beans/cookie/CookieManager;->initCookieManager(Landroid/content/Context;)V

    .line 118
    sget-object v2, Landroid/webkit/WebSettings$RenderPriority;->LOW:Landroid/webkit/WebSettings$RenderPriority;

    invoke-static {v2}, Lcom/burstly/lib/BurstlySdk;->setWebViewRedneringPriority(Landroid/webkit/WebSettings$RenderPriority;)V

    .line 121
    invoke-static {}, Lcom/burstly/lib/constants/Constants;->getInstance()Lcom/burstly/lib/constants/Constants;

    .line 124
    invoke-static {}, Lcom/burstly/lib/util/Utils;->checkIsUiThread()V

    .line 127
    invoke-static {}, Lcom/burstly/lib/feature/FeatureFactory;->getDTrackFeature()Lcom/burstly/lib/feature/dtracker/IDownloadTracker;

    move-result-object v1

    .line 128
    .local v1, tracker:Lcom/burstly/lib/feature/dtracker/IDownloadTracker;
    if-eqz v1, :cond_1

    .line 129
    invoke-interface {v1, v0}, Lcom/burstly/lib/feature/dtracker/IDownloadTracker;->sendDTRequestIfNeeded(Landroid/content/Context;)V

    .line 131
    :cond_1
    sget-object v2, Lcom/burstly/lib/BurstlySdk;->sLog:Lcom/burstly/lib/util/LoggerExt;

    const-string v3, "BurstlySdk"

    const-string v4, "Burstly SDK was successfully initilaized."

    const/4 v5, 0x0

    new-array v5, v5, [Ljava/lang/Object;

    invoke-virtual {v2, v3, v4, v5}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 132
    return-void
.end method

.method public static setWebViewRedneringPriority(Landroid/webkit/WebSettings$RenderPriority;)V
    .locals 3
    .parameter "priority"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/burstly/lib/exception/BurstlySdkNotInitializedException;
        }
    .end annotation

    .prologue
    .line 169
    sget-boolean v1, Lcom/burstly/lib/BurstlySdk;->sIsInitialized:Z

    if-eqz v1, :cond_0

    .line 170
    new-instance v0, Landroid/webkit/WebView;

    invoke-static {}, Lcom/burstly/lib/util/Utils;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Landroid/webkit/WebView;-><init>(Landroid/content/Context;)V

    .line 171
    .local v0, webView:Landroid/webkit/WebView;
    invoke-virtual {v0}, Landroid/webkit/WebView;->getSettings()Landroid/webkit/WebSettings;

    move-result-object v1

    invoke-virtual {v1, p0}, Landroid/webkit/WebSettings;->setRenderPriority(Landroid/webkit/WebSettings$RenderPriority;)V

    .line 175
    return-void

    .line 173
    .end local v0           #webView:Landroid/webkit/WebView;
    :cond_0
    new-instance v1, Lcom/burstly/lib/exception/BurstlySdkNotInitializedException;

    const-string v2, "Call BurstlySdk.init(context) method first!"

    invoke-direct {v1, v2}, Lcom/burstly/lib/exception/BurstlySdkNotInitializedException;-><init>(Ljava/lang/String;)V

    throw v1
.end method

.method public static shutdown(Landroid/content/Context;)V
    .locals 1
    .parameter "context"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/burstly/lib/exception/WrongThreadException;
        }
    .end annotation

    .prologue
    .line 144
    invoke-static {}, Lcom/burstly/lib/util/Utils;->checkIsUiThread()V

    .line 145
    invoke-static {p0}, Lcom/burstly/lib/network/request/RequestManager;->shutdown(Landroid/content/Context;)V

    .line 146
    invoke-static {}, Lcom/burstly/lib/exception/UiExceptionHandlerManager;->cleanUp()V

    .line 147
    invoke-static {}, Lcom/burstly/lib/service/SdCardWatchingService;->stopWatching()V

    .line 148
    const-string v0, "IP list request"

    invoke-static {v0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->abortAllRequests(Ljava/lang/String;)V

    .line 149
    sget-object v0, Lcom/burstly/lib/downloadtracker/DownloadTrackingManager;->TAG:Ljava/lang/String;

    invoke-static {v0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->abortAllRequests(Ljava/lang/String;)V

    .line 150
    invoke-static {}, Lcom/burstly/lib/service/ServerConfigurationService;->shutdown()V

    .line 151
    invoke-static {}, Lcom/burstly/lib/cache/CacheManager;->releaseCaches()V

    .line 152
    invoke-static {}, Lcom/burstly/lib/component/AdaptorFactoryCache;->destroy()V

    .line 153
    return-void
.end method

.method public static wasInit()Z
    .locals 1

    .prologue
    .line 160
    sget-boolean v0, Lcom/burstly/lib/BurstlySdk;->sIsInitialized:Z

    return v0
.end method
